package org.wishwork.api.product.combine;

import org.wishwork.api.product.combine.query.CombineProductQueryApi;
import org.wishwork.api.product.combine.query.CombineProductQueryRequest;
import org.wishwork.api.product.combine.query.CombineProductQueryResponse;
import org.wishwork.api.product.combine.upload.CombineProductUploadApi;
import org.wishwork.api.product.combine.upload.CombineProductUploadResponse;
import org.wishwork.api.product.combine.upload.request.CombineProductUploadRequest;
import org.wishwork.api.product.common.item.query.CommonProductItemQueryRequest;
import org.wishwork.context.Context;

import java.util.List;

/**
 * @description: 组合商品
 * @author: WangYX
 * @create: 2022-04-11 15:38
 * @Version: 1.0.0
 **/

public class CombineProductApi {

    private Context context;

    private final CombineProductQueryApi combineProductQueryApi;

    private final CombineProductUploadApi combineProductUploadApi;

    public CombineProductApi(Context context) {
        this.context = context;
        this.combineProductQueryApi = new CombineProductQueryApi(context);
        this.combineProductUploadApi = new CombineProductUploadApi(context);
    }

    /**
     * 组合装商品查询
     *
     * @param combineProductQueryRequest
     * @return
     * @throws Exception
     */
    public List<CombineProductQueryResponse> query(CombineProductQueryRequest combineProductQueryRequest) throws Exception {
        return this.combineProductQueryApi.business(combineProductQueryRequest);
    }

    /**
     * 组合装商品上传
     *
     * @param combineProductUploadRequest
     * @return
     * @throws Exception
     */
    public CombineProductUploadResponse upload(CombineProductUploadRequest combineProductUploadRequest) throws Exception {
        return this.combineProductUploadApi.business(combineProductUploadRequest);
    }


}
